package ipgather.core.proxy.thread;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.junit.Test;

import com.alibaba.fastjson.JSON;

import ipgather.core.redis.RedisDbAdapter;
import ipgather.entity.Host;
import redis.clients.jedis.Jedis;

public class HostCustomer extends Thread{
	
	private SyncStackHost stackHost;
	private HttpGet request = new HttpGet("http://yunpan.360.cn");
	private CloseableHttpClient httpClient = null;
	public HostCustomer(SyncStackHost stackHost,CloseableHttpClient httpClient) {
		this.stackHost = stackHost;
		this.httpClient = httpClient;
	}

	@Override
	public void run() {
		Host host = null;
		RedisDbAdapter redisDbAdapter = RedisDbAdapter.create();
		while(true){
			host = stackHost.pop();
			if(!new ProxyCheck(httpClient).checkProxyHost(host)){
				//redisDbAdapter.delHost(host);
			}
		}
	}
	
}
